package hunglv.android.rss;

import android.os.Bundle;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.view.Menu;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class DescriptionActivity extends Activity {
	WebView webContentView;
	ProgressDialog mDialog;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_description);
        
        webContentView = (WebView)findViewById(R.id.webContent);
        
        mDialog = new ProgressDialog(this);
        mDialog.show();
        
        Intent intent = getIntent();
        Bundle mBundle = intent.getBundleExtra("hunglv.android.rss.rss_item");

        webContentView.loadUrl(mBundle.getString("link"));
    	webContentView.setWebViewClient(new WebViewClient(){
    		@Override
    		public void onPageFinished(WebView view, String url) {
    	        mDialog.hide();
    	    }
    	});
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_description, menu);
        return true;
    }

    
}
